<template>
	<view class="result-data">
		<view class="data-item-1">
			<view class="data-item-1-box">
				<view class="data-item-1-box-tit">总资产（累计业绩）</view>
				<view class="data-item-1-box-all-money">
					<navigator url="/pages/my/results-data/results-info/results-info?time=month" class="navigator">
						<text>￥<text>{{moneyData.price.all_price}}</text></text>
						<image src="https://master.jiaju01.com/web/static/icons/ico_more_data@2x.png"></image>
					</navigator>
				</view>
				<view class="data-item-1-box-compared-money">
					<text>本月业绩{{moneyData.price.month_price}}元</text>
					<text>上月业绩{{moneyData.price.last_month_price}}元</text>
				</view>
				<view class="data-item-1-box-list">
					<view>
						<navigator url="/pages/my/results-data/results-info/results-info">
							<text>累计利润</text>
							<text>{{moneyData.royalty.all_price}}<text>元</text></text>
						</navigator>
					</view>
					<view>
						<navigator url="/pages/my/results-data/results-info/results-info?time=month">
							<text>本月利润</text>
							<text>{{moneyData.royalty.month_price}}<text>元</text></text>
						</navigator>
					</view>
					<view>
						<navigator url="/pages/my/results-data/results-info/results-info?time=lastMonth">
							<text>上月利润</text>
							<text>{{moneyData.royalty.last_month_price}}<text>元</text></text>
						</navigator>
					</view>
				</view>
			</view>
		</view>

		<view class="data-item data-item-white data-item-2">
			<view class="data-item-tit">
				<view class="tit-name">今日营收</view>
				<view class="tit-more">
					<navigator url="/pages/my/results-data/results-info/results-info?time=today">
						详情<image src="https://master.jiaju01.com/web/static/icons/ico_more_home@2x.png"></image>
					</navigator>
				</view>
			</view>
			<view class="data-item-list col-2">
				<view>
					<text>今日业绩</text>
					<text class="orange">{{moneyData.price.today_price}}<text>元</text></text>
				</view>
				<view>
					<text>今日利润</text>
					<text class="orange">{{moneyData.royalty.today_price}}<text>元</text></text>
				</view>
			</view>
			<view class="data-item-tit">
				<view class="tit-name">昨日营收</view>
				<view class="tit-more">
					<navigator url="/pages/my/results-data/results-info/results-info?time=yesterday">
						详情<image src="https://master.jiaju01.com/web/static/icons/ico_more_home@2x.png"></image>
					</navigator>
				</view>
			</view>
			<view class="data-item-list col-2">
				<view>
					<text>昨日业绩</text>
					<text class="blue">{{moneyData.price.yesterday_price}}<text>元</text></text>
				</view>
				<view>
					<text>昨日利润</text>
					<text class="blue">{{moneyData.royalty.yesterday_price}}<text>元</text></text>
				</view>
			</view>
		</view>

		<view class="data-item data-item-white">
			<view class="data-item-tit">
				<view class="tit-name">用户数据</view>
			</view>
			<view class="member-list">
				<view class="member-item"><text>普通用户</text>
					<view>{{alluser}}
						<!-- <image src="https://master.jiaju01.com/web/shopImgs/more_3.png"></image> -->
					</view>
				</view>
			</view>
		</view>
		<pt-loading></pt-loading>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				moneyData: {
					price: {
						last_month_price: 0,
						last_week_price: 0,
						month_price: 0,
						today_price: 0,
						week_price: 0,
						yesterday_price: 0
					},
					royalty: {
						last_month_price: 0,
						last_week_price: 0,
						month_price: 0,
						today_price: 0,
						week_price: 0,
						yesterday_price: 0
					}
				},
				alluser: 0
			};
		},
		onShow() {
			this.getData()
			this.getAllUser()
		},
		methods: {
			// 获取业绩
			getData() {
				this.$u.apiWei.UserMoneyData().then(res => {
					this.moneyData = res.datas
				})
			},
			// 获取用户数
			getAllUser() {
				this.$u.apiWei.UserShareData().then(res => {
					this.alluser = res.datas.user_mub
				})
			},
		}
	}
</script>

<style lang="scss">
	.result-data {
		padding-bottom: 30rpx;


		.data-item-1 {
			background-color: #2073F5;
			padding: 10rpx 30rpx 60rpx;
			color: #FFF;
		}

		.data-item-1-box-tit {
			margin-top: 50rpx;
			font-size: 28rpx;
		}

		.data-item-1-box-all-money .navigator {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin: 30rpx 0;
		}

		.data-item-1-box-all-money text {
			font-weight: bold;
			font-size: 42rpx;
		}

		.data-item-1-box-all-money text text {
			font-size: 68rpx;
		}

		.data-item-1-box-all-money image {
			width: 50rpx;
			height: 50rpx;
		}

		.data-item-1-box-compared-money {
			font-size: 24rpx;
			padding-bottom: 30rpx;
			margin-bottom: 30rpx;
			border-bottom: solid 1px rgba(255, 255, 255, 0.4);
		}

		.data-item-1-box-compared-money text {
			margin-right: 80rpx;
		}

		.data-item-1-box-list {
			display: flex;
			justify-content: space-between;
			text-align: center;
		}

		.data-item-1-box-list view:first-child {
			text-align: left;
		}

		.data-item-1-box-list text {
			font-size: 36rpx;
			display: block;
		}

		.data-item-1-box-list text text {
			display: inline-block;
			font-size: 24rpx;
		}

		.data-item-1-box-list text:first-child {
			font-size: 24rpx;
			margin-bottom: 30rpx;
		}

		.data-item-white {
			background-color: #FFF;
			padding: 30rpx;
			margin-top: 20rpx;
			border-radius: 20rpx;
		}

		.data-item-2 {
			margin-top: -30rpx;
		}

		.data-item-tit {
			display: flex;
			align-items: center;
			justify-content: space-between;
		}

		.data-item-tit .tit-name {
			font-size: 34rpx;
		}

		.data-item-tit .tit-more {
			color: #999;
			font-size: 24rpx;
		}

		.data-item-tit .tit-more image {
			margin-top: 8rpx;
			width: 12rpx;
			height: 21rpx;
			margin-left: 10rpx;
		}

		.data-item-list {
			display: flex;
			flex-wrap: wrap;
			margin-bottom: 30rpx;
			padding-bottom: 30rpx;
			border-bottom: solid 1px #EEE;
		}

		.data-item-list:last-child {
			margin-bottom: 0;
			padding-bottom: 0;
			border-bottom: none;
		}

		.data-item-list view text {
			display: block;
			font-size: 26rpx;
			color: #666;
		}

		.data-item-list view text:first-child {
			margin-bottom: 30rpx;
		}

		.data-item-list view text:last-child {
			font-size: 48rpx;
			color: #000;
		}

		.data-item-list view text:last-child text {
			display: inline-block;
			font-size: 28rpx;
		}

		.data-item-list view .orange {
			color: #FE9B26 !important;
		}

		.data-item-list view .orange text:last-child {
			margin-bottom: 0;
			color: #FE9B26 !important;
		}

		.data-item-list view .blue {
			color: #2073F5 !important;
		}

		.data-item-list view .blue text:last-child {
			margin-bottom: 0;
			color: #2073F5 !important;
		}

		.data-item-list.col-2 view {
			width: 50%;
			margin-top: 50rpx;
		}

		.data-item-list.col-3 view {
			width: 33.3333%;
			margin-top: 50rpx;
		}

		.member-item {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 30rpx;
		}

		.member-item text {
			color: #666;
			font-size: 26rpx;
		}

		.member-item image {
			display: inline-block;
			width: 12rpx;
			height: 21rpx;
			margin: 8rpx 0 0 10rpx;
		}
	}
</style>
